package cn.SiFuLan.controls;

import cn.SiFuLan.dao.IbrandDao;
import cn.SiFuLan.dao.impl.brandDaoImpl;
import cn.SiFuLan.entity.brandEntity;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(urlPatterns = "/admin/bupdate.shtml")
public class bupdate1 extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        IbrandDao ibrandDao=new brandDaoImpl();
        String brandid=request.getParameter("Brandid");
        brandEntity brand=null;
        if(brandid!=null && ! brandid.equals("")){
            brand=ibrandDao.getall(Integer.parseInt(brandid));
        }
        request.setAttribute("brand",brand);
        request.getRequestDispatcher("Bupdate2.jsp").forward(request,response);
    }
}
